Skip to main content

Useful CLI queries

Query the constitution:

cardano-cli conway query constitution --testnet-magic 4
{
"anchor": {
"dataHash": "5d372dca1a4cc90d7d16d966c48270e33e3aa0abcb0e78f0d5ca7ff330d2245d",
"url": "https://tinyurl.com/4xdkkjm3"
}
}

Query the DRep state for all DReps:

cardano-cli conway query drep-state --testnet-magic 4 --all-dreps


[
[
{
"scriptHash": "1d8fe9486b5fb282287568f04445c8f4d6cddf76ce2df527fd7debbe"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 108
}
],
[
{
"keyHash": "1da9afe241a10fe5ee9590843134d0eebd4a32af448c9ec91db2e863"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 177
}
],
[
{
"keyHash": "480036de36a123e98663370e4829ebd43aa9bb06ec4b6b25f3e178db"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 176
}
],
[
{
"keyHash": "5b440956e056c96c74d4820b39b4f91cc45bb2b46024c96a594bb2ed"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 176
},

]
]

Query the DRep state for an individual DRep:

cardano-cli conway query drep-state --drep-key-hash 1da9afe241a10fe5ee9590843134d0eebd4a32af448c9ec91db2e863 --testnet-magic 4
[
[
{
"keyHash": "1da9afe241a10fe5ee9590843134d0eebd4a32af448c9ec91db2e863"
},
{
"anchor": null,
"deposit": 2000000,
"expiry": 188
}
]
]

Query the DRep stake distribution (voting power):

cardano-cli conway query drep-stake-distribution --testnet-magic 4
[
[
"drep-keyHash-13797df5308dfebf2348fa58b312a177cf97939f5f7d21168e1a54db",
500000000000
],
[
"drep-keyHash-9853551d8b99884f51608822e012bbf0d444eb7bea2807ee664f1241",
495790521257
],
[
"drep-keyHash-cf09b59e134fa14e48da39b552c02299a054d7c8b895b3d827453672",
500000000000
]
]

Query the committee state:

cardano-cli conway query committee-state --testnet-magic 4
{
"committee": {
"keyHash-5e86313210aef13297187c38c98abb632678906230f555a1bf0a647a": {
"expiration": 161,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "e394a160b9f1345b7b84cd25f0a3f1d12cb0c9835a4167f7dc5b52ca"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
},
"keyHash-8be41436ce39ca3c2f3e4255e17fc6c11581ef6787bccf9ab60f39dd": {
"expiration": 181,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "e6442af170fabe877ba6b23136ffb32026e9ed927158ecdda2ef0e18"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
},
"keyHash-da9f5c5c94a6709a9188838ce8cd7fe1c39a1923de4933c16d67c1e0": {
"expiration": 201,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "f380b5c4f245f9987645023e39b487e11a7d2337aea91dde628d04ed"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
}
},
"epoch": 86,
"quorum": 0.6666666666666666666
}

Query the state of an individual committee key hash:

cardano-cli conway query committee-state --cold-verification-key-hash da9f5c5c94a6709a9188838ce8cd7fe1c39a1923de4933c16d67c1e0 --testnet-magic 4
{
"committee": {
"keyHash-da9f5c5c94a6709a9188838ce8cd7fe1c39a1923de4933c16d67c1e0": {
"expiration": 201,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "f380b5c4f245f9987645023e39b487e11a7d2337aea91dde628d04ed"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
}
},
"epoch": 89,
"quorum": 0.6666666666666666666
}

Query expired committee members

cardano-cli conway query committee-state --expired --testnet-magic 4
{
"committee": {
"keyHash-059349cd1e77dc3e500d3ffc498adb7307001ecc022c8b083faaa48b": {
"expiration": 161,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "23e05ad2b71317a6348ce4b68dae37aa1c0e545cdea740b23c21742e"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Expired"
}
},
"epoch": 169,
"quorum": 0.6
}

Query active committee members

cardano-cli conway query committee-state --active --testnet-magic 4
{
"committee": {
"keyHash-059349cd1e77dc3e500d3ffc498adb7307001ecc022c8b083faaa48b": {
"expiration": 161,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "23e05ad2b71317a6348ce4b68dae37aa1c0e545cdea740b23c21742e"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
},
"keyHash-337e0a7fd01c7a7c27e8bac17e40db182bc2a774467795af1e3fe8a9": {
"expiration": 201,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "540bedcd4bdcbf523e899c3ef43f2b96ecec4f6303af58d15a413ed1"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
},
"keyHash-9c2aabae5d9187a76ed6b04b40e91ecb4ce3171611c3fd4ec6c6a607": {
"expiration": 181,
"hotCredsAuthStatus": {
"contents": {
"keyHash": "6c1d098a366f2274651943a7f778b3b5459c129f0407a0db2902253a"
},
"tag": "MemberAuthorized"
},
"nextEpochChange": "NoChangeExpected",
"status": "Active"
}
},
"epoch": 105,
"quorum": 0.6
}

Query unrecognized committee keys

cardano-cli conway query committee-state --unrecognized --testnet-magic 42
{
"committee": {},
"epoch": 106,
"quorum": 0.6
}